package com.course.file.controller.admin;

import com.course.server.common.PageRequest;
import com.course.server.common.Result;
import com.course.server.service.FileService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: Durian
 * @date: 2021/5/9 12:18
 */
@RestController
@RequestMapping("/admin/files")
public class FileController {

    /**
     * 用于日志记录使用
     */
    public static final String BUSINESS_NAME = "文件管理";

    @Resource
    private FileService fileService;

    @GetMapping
    public Result list(@Validated PageRequest request) {
        return Result.success(fileService.list(request.getPage(), request.getSize()));
    }

}
